import random
bags = [[], [], []]
color = ["红", "黄", "蓝"]
globes = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
for globe in globes:
    index = random.randint(0, 2)
    bags[index].append(globe)
i = 0
for bag in bags:
    print("%s袋子中球的序号: %d" % (color[i], len(bag)))
    i =i+1
    for name in bag:
        print("%s" % name, end="\t")
    print("-" * 20)